<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./layout/mainTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">
    
    <ui:define name="content">
        <h:form >
            <p:panel header="Categorias">
            <p:dataGrid columns="1" rows="10" paginator="true" value="#{gestorPrincipal.categorias}" var="categoria" 
                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
                <p:panel header="#{categoria.nombre}">
                    <h:outputText value="#{categoria.descripcion}"/>
                    <br></br>
                    <p:commandButton icon="ui-icon-note" value="Mostrar Contenido"  action="#{gestorPrincipal.obtenerLibrosCategoria()}" ajax="false">
                        <f:setPropertyActionListener value="#{categoria}"   
                                                     target="#{gestorPrincipal.selectedCategoria}" />  
                    </p:commandButton>
                </p:panel>            
            </p:dataGrid>
            
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>